﻿//using System;
//using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
//using System.Windows.Documents;
//using System.Windows.Ink;
//using System.Windows.Input;
//using System.Windows.Media;
//using System.Windows.Media.Animation;
//using System.Windows.Shapes;
using uhul;


namespace uhul.Controls
{
	public partial class AppMenu : UserControl
	{



    public AppMenu()
		{
			// Required to initialize variables
			InitializeComponent();
		}





    //public static ObservableCollection<AppInfo> AvailableApplications
    //{
    //  get { return XapExplorer.AvailableApplications; }
    //}




    private void RunApp(object sender, RoutedEventArgs e)
    {
      AppVCard tmp = (AppVCard)sender;




      //run app cmd
      XapExplorer.Commands.Add(
        new Command()
        {
          TargetApplicationName = tmp.AppInfo.Name,
          //CommandVisualBehaviour = CommandVisualBehaviourEnum.ShowAsActive,
          CommandType = CommandTypeEnum.RunApplication
        }.ToJson()
      );

      //set app active cmd
      XapExplorer.Commands.Add(
        new Command()
        {
          TargetApplicationName = tmp.AppInfo.Name,
          //CommandVisualBehaviour = CommandVisualBehaviourEnum.ShowAsActive,
          CommandType = CommandTypeEnum.ActivateApp
        }.ToJson()
      );
      //XapExplorer.RunApplication(tmp.AppInfo);
      //XapExplorer.SetActiveApplication(tmp.AppInfo.Name);



    }

	}

}